<template>
  <div>
    <el-empty v-if="list.length == 0" description="暂无数据"></el-empty>
    <div v-if="list.length > 0">
      <p class="title">{{title}}</p>
      <el-row class="list" v-for="item in list">
        <el-col :span="18" class="listleft">
          {{item.vName}}
        </el-col>
        <el-col :span="6" class="listright">
          <el-link type="primary" :underline="false" @click="userClick(item)">查看</el-link>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { sessionArchivingUserListGet } from '../../../../api/index';

export default {
  data() {
    return {
      title: '',
      list: [],
    };
  },
  created() {

  },

  methods: {
    getList(obj) {
      this.list = [];
      this.title = obj.label;
      sessionArchivingUserListGet({
        departmentId: obj.id,
        did: obj.did
      }).then((res) => {
        if (res.code == 0) {
          // console.log(res);
          this.list = res.list;
        } else {
          this.$message(res.msg);
        }
      })
    },
    //点击人员查看
    userClick(item) {
      this.$emit("CTuserList", item)
    },
  },
  mounted() {
    this.$nextTick(function() {
      this.$on("getInit", function(obj) {
        this.getList(obj);
      })
    })
  }
};
</script>

<style scoped>
/deep/ :focus {
    outline: 0;
}
.title {
    text-align: center;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.list {
    border-bottom: 1px solid #eee;
    padding: 8px 5px;
}
.list .listleft {
    font-size: 14px;
    color: #333;
}
</style>